#include <stdio.h>
#include <stdlib.h>
#include "dominion.h"

void testing(struct gameState *game);

int main(int argc, char *argv[])
{
	struct gameState *game = malloc(sizeof(struct gameState));

	testing(game);

	free(game);

	return 0;
}

void testing(struct gameState *game)
{
	struct gameState *after = malloc(sizeof(struct gameState));

	int h_size = 0;

	printf("UNIT TEST 3...........\n");

	printf("BEGIN TESTING SCORE FOR\n");

	for(int i = 0; i < 10; i ++)
	{
		h_size = (rand() % 10) + 5;
		for(int j = 0; j < h_size; j++)
		{
			game->deck[0][j] = 42;
			game->deckCount[0]++;
		}
		memcpy(after, game, sizeof(struct gameState));

		scoreFor(i, game);

		printf("Hand Size = %d\n", h_size);
		int compare = memcmp(game, after, sizeof(struct gameState));
		if(compare == 0)
		{
			printf("Test FAILED.\n");
		}
		else
		{
			printf("Test PASSED.\n");
		}
	}
	free(after);

	return;
}